import { ogImage, OG_SIZE, OG_CONTENT_TYPE } from '@/lib/og'; import { getBiomarkerBySlug } from '@/lib/queries/biomarkers'; import { humanize } from '@/lib/format'; export const alt = 'CancerIndex biomarker page'; export const size = OG_SIZE; export const contentType = OG_CONTENT_TYPE; export const revalidate = 3600; export default async function Image({ params }: { params: Promise<{ slug: string }> }) { const { slug } = await params; const b = await getBiomarkerBySlug(slug); if (!b) return ogImage({ kicker: 'Biomarker', title: 'Biomarker not found', subtitle: slug }); const genes = (b.gene_symbols ?? []).slice(0, 4).join(', '); return ogImage({ kicker: `Biomarker · ${humanize(b.kind)}${b.ncit_code ? ` · NCIt ${b.ncit_code}` : ''}`, title: b.name, subtitle: b.description ?? (genes ? `Anchor gene${genes.includes(',') ? 's' : ''}: ${genes}` : 'Curated biomarker with derived links to cancers, drugs, approvals and trials.'), facts: genes ? [{ label: 'anchor genes', value: genes }] : [], sourcesNote: 'NCIt (EVS) · CIViC · openFDA / Health Canada / EMA · ClinicalTrials.gov', }); }